package com.aptech.domain.JPA;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * NewsId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class NewsId implements java.io.Serializable {

	// Fields

	private Integer newsId;
	private Integer newsCategoryId;
	private Integer accountId;

	// Constructors

	/** default constructor */
	public NewsId() {
	}

	/** full constructor */
	public NewsId(Integer newsId, Integer newsCategoryId, Integer accountId) {
		this.newsId = newsId;
		this.newsCategoryId = newsCategoryId;
		this.accountId = accountId;
	}

	// Property accessors

	@Column(name = "NEWS_ID", nullable = false)
	public Integer getNewsId() {
		return this.newsId;
	}

	public void setNewsId(Integer newsId) {
		this.newsId = newsId;
	}

	@Column(name = "NEWS_CATEGORY_ID", nullable = false)
	public Integer getNewsCategoryId() {
		return this.newsCategoryId;
	}

	public void setNewsCategoryId(Integer newsCategoryId) {
		this.newsCategoryId = newsCategoryId;
	}

	@Column(name = "ACCOUNT_ID", nullable = false)
	public Integer getAccountId() {
		return this.accountId;
	}

	public void setAccountId(Integer accountId) {
		this.accountId = accountId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof NewsId))
			return false;
		NewsId castOther = (NewsId) other;

		return ((this.getNewsId() == castOther.getNewsId()) || (this
				.getNewsId() != null
				&& castOther.getNewsId() != null && this.getNewsId().equals(
				castOther.getNewsId())))
				&& ((this.getNewsCategoryId() == castOther.getNewsCategoryId()) || (this
						.getNewsCategoryId() != null
						&& castOther.getNewsCategoryId() != null && this
						.getNewsCategoryId().equals(
								castOther.getNewsCategoryId())))
				&& ((this.getAccountId() == castOther.getAccountId()) || (this
						.getAccountId() != null
						&& castOther.getAccountId() != null && this
						.getAccountId().equals(castOther.getAccountId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getNewsId() == null ? 0 : this.getNewsId().hashCode());
		result = 37
				* result
				+ (getNewsCategoryId() == null ? 0 : this.getNewsCategoryId()
						.hashCode());
		result = 37 * result
				+ (getAccountId() == null ? 0 : this.getAccountId().hashCode());
		return result;
	}

}